home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Harvest C / MPW Int & Lib / Interfaces / Unmangler.h < prev    next >
Text File  |  1991-04-17  |  2KB  |  54 lines

  1. /*---------------------------------------------------------------------------*
  2.  |                                                                           |
  3.  |                            <<< Unmangler.h >>>                            |
  4.  |                                                                           |
  5.  |                         C++ Function Name Decoding                        |
  6.  |                                                                           |
  7.  |                 Copyright Apple Computer, Inc. 1988-1991                  |
  8.  |                           All rights reserved.                            |
  9.  |                                                                           |
  10.  *---------------------------------------------------------------------------*/
  11.  
  12. #ifndef __UNMANGLER__
  13. #define __UNMANGLER__
  14.  
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18.  
  19. int unmangle(char *dst, char *src, int limit);
  20.     /*
  21.     This function unmangles C++ mangled symbols (i.e. a symbol with a type signature).  The
  22.   mangled C string is passed in “src” and the unmangled C string is returned in “dst”.  Up
  23.   to “limit” characters (not including terminating null) may be retured in “dst”.
  24.  
  25.   The function returns,
  26.  
  27.          -1 ==> error, probably because symbol was not mangled, but looked like it was
  28.             0 ==> symbol wasn't mangled; not copied either
  29.             1 ==> symbol was mangled; unmangled result fit in buffer
  30.             2 ==> symbol was mangled; unmangled result truncated to fit in buffer (null written)
  31.     */
  32.  
  33.  
  34. pascal int Unmangle(char *dst, char *src, int limit);
  35.     /*
  36.     This function unmangles C++ mangled symbols (i.e. a symbol with a type signature).  The
  37.     mangled Pascal string is passed in “src” and the unmangled Pascal string is returned in
  38.     “dst”.  Up to “limit” characters may be retured in “dst”.
  39.     
  40.     The function returns,
  41.     
  42.          -1 ==> error, probably because symbol was not mangled, but looked like it was
  43.             0 ==> symbol wasn't mangled; not copied either
  44.             1 ==> symbol was mangled; unmangled result fit in buffer
  45.             2 ==> symbol was mangled; unmangled result truncated to fit in buffer (null written)
  46.             
  47.     This function is identical to unmangle() above except that all the strings are Pascal
  48.     instead of C strings.
  49.     */
  50.  
  51. #ifdef __cplusplus
  52. }
  53. #endif
  54. #endif